PVector tier[][];
int numOfTiers = 2;
int numOfDots = 30;
float tWidth, tHeight;

void generateTiers()
{
  tier = new PVector[numOfTiers+1][numOfDots];
  tHeight = height / numOfTiers;
  tWidth = width / numOfDots;
  for (int i=0; i<numOfTiers; ++i) {
    tier[i][0] = new PVector(0, height / 2);
    for (int j=1; j<numOfDots-1; ++j) {
      float x = random(j * tWidth, (j + 1) * tWidth);
      float y = random(i * tHeight, (i + 1) * tHeight);
      tier[i][j] = new PVector(x, y);
    }
    tier[i][numOfDots-1] = new PVector(width, 
        random(i * tHeight, (i + 1) * tHeight));
  }
  for (int i=0; i<numOfDots; ++i) {
    tier[numOfTiers][i] = new PVector(0 + i * tWidth, height);
  }
}

void setup()
{
  size(700, 400);
  smooth();
  generateTiers();
  
  for (int i=0; i<numOfTiers; ++i) {
    
    fill(50 + i * 100);
    beginShape();
    
      for (int j=0; j<numOfDots; ++j) {
        curveVertex(tier[i][j].x, tier[i][j].y);
      }
      
      for (int j=numOfDots-1; j>=0; --j) {
        curveVertex(tier[i+1][j].x, tier[i+1][j].y);
      }
    endShape();
  }
}

